<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算属性</title>
    <script src="vue/vue.js"></script>
</head>
<body>
    <div id="app">
        <span>{{a}}</span>
        <span>{{b}}</span>

    </div>
    <script>
        let vm=new Vue({
            el:"#app",
            data:{
                a:10
            },
            computed:{
                //属性 业务逻辑
              b:function () {
                  return this.a+10;
              }
            }
        });
        document.onclick=function () {
            vm.a=100;
        }
    </script>
</body>
</html>